package com.lry.jvm.classfile.constantpool;

import com.lry.jvm.classfile.ClassReader;

public class ConstantMethodTypeInfo implements ConstantInfo {

    private ConstantPool cp;
    private int descriptorIndex;

    public ConstantMethodTypeInfo(ConstantPool cp, ClassReader reader){
        this.cp = cp;
        this.descriptorIndex = reader.nextU2ToInt();
    }

    public String getValue() {
        return this.cp.getUTF8(this.descriptorIndex);
    }

    @Override
    public String toString() {
        return this.cp.getUTF8(this.descriptorIndex);
    }
}
